#pragma once

#include "RHITexture.h"
#include <string>

class Image3DTexture : public RHITexture
{
	struct BuilderDetails {

		bool isMultiple;

		VkFormat format;
		VkExtent3D extent;

		VkSharingMode sharingMode;
		std::vector<VkQueueFlagBits> queueFamilys;

		void* data;

		BuilderDetails()
		{
			isMultiple = false;

			format = VK_FORMAT_R8G8B8A8_UNORM;
			extent = { 0, 0, 0 };
			sharingMode = VK_SHARING_MODE_EXCLUSIVE;

			data = nullptr;
		}
	};

public:

	class Builder : public BuilderBase<BuilderDetails> {
		friend struct BuilderDetails;
	public:
		Builder() noexcept;
		Builder(Builder const& rhs) noexcept;
		Builder(Builder&& rhs) noexcept;
		~Builder() noexcept;
		Builder& operator=(Builder const& rhs) noexcept;
		Builder& operator=(Builder&& rhs) noexcept;

		Builder& SetMultiple(bool isMultiple) noexcept;

		Builder& SetFormat(VkFormat format) noexcept;
		Builder& SetExtent(VkExtent3D extent) noexcept;
		Builder& SetWidth(uint32 width) noexcept;
		Builder& SetHeight(uint32 height) noexcept;
		Builder& SetDepth(uint32 depth) noexcept;
		Builder& SetSharingMode(VkSharingMode sharingMode) noexcept;
		Builder& AddQueueFamily(VkQueueFlagBits queueFlag) noexcept;

		Builder& SetData(void* data) noexcept;

		RefCountPtr<Image3DTexture> Build();
		RefCountPtr<Image3DTexture> Build(RenderProcess* process, const std::string& name);

	private:
		friend class Image3DTexture;
	};

	Image3DTexture(BuilderDetails& builderDetails);

	virtual void ReleaseResource() override;

};